package com.ask.controller;

import com.ask.dto.Result;
import com.ask.service.businessService.IVoucherOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/voucher-order")
//@Tag(name = "优惠卷订单接口")
public class VoucherOrderController {

    @Autowired
    private IVoucherOrderService voucherOrderService;

//    @PostMapping("/seckill/{voucherId}")
//    public Result seckillVoucher(@PathVariable("voucherId") Long voucherId) {
//        return voucherOrderService.seckillVoucher_KafkaMq(voucherId);
//    }

    @PostMapping("/seckill/{voucherId}/{userId}")
    public Result seckillVoucherV2(@PathVariable("voucherId") Long voucherId,
                                   @PathVariable("userId") Long userId ) {
        return voucherOrderService.seckillVoucher_KafkaMq(voucherId, userId);
    }
}
